<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
    <title>Logback-beagle</title>
    <link rel="stylesheet" type="text/css" href="../css/common.css" />
    <link rel="stylesheet" type="text/css" href="../css/screen.css" media="screen" />
    <link rel="stylesheet" type="text/css" href="../css/_print.css" media="print" />
    <link rel="stylesheet" type="text/css" href="../css/prettify.css" media="screen" />
    
  </head>
  <body onload="prettyPrint(); decorate();">
    <script type="text/javascript">prefix='../';</script>
    <script type="text/javascript" src="../js/prettify.js"></script>
    <script type="text/javascript" src="../templates/header.js"></script>
    <script type="text/javascript" src="../js/dsl.js"></script>
    <script type="text/javascript" src="../js/jquery-min.js"></script>
    <script type="text/javascript" src="../js/decorator.js"></script>

    <div id="left">
      <noscript>Please turn on Javascript to view this menu</noscript>
      <script src="../templates/left.js" type="text/javascript"></script>
    </div>
    <div id="right">
      <script src="../templates/right.js" type="text/javascript"></script>
    </div>

    <div id="content">

    <img style="float:left; margin-right: 1em;" src="images/sailing-ship-128x128.png" alt=""/>             
      <h1>Logback-beagle</h1>
	

      <script src="../templates/creative.js" type="text/javascript"></script>





		<h2 class="doAnchor">Logback-beagle: an Eclipse plug-in for
		viewing logs</h2>


    <p>During the development process, it is common for developers to
    print logging events on the console. Typically, the developer will
    also customize the format of the log output by setting an
    appropriate layout pattern.  Logback-beagle is intended as a
    replacement for viewing logs via the console. It offers several
    advantages over the plain-old console:
    </p>
    
    <ul>

      <li>Events of level WARN and ERROR are marked by an orange flag
      and respectively a red flag.</li>

      <li>Quickly jump to the class and line where a given logging
      request originated
      </li>

      <li>Easly view and jump to the callers of any log statement upto
      eight levels deep</li>
  
      <li>Change the output format on-the-fly</li>

      <li>quickly filter-out events by setting the level of existing
      loggers</li>

      <li>Measure the time elapsed between any two lines of log</li>
    </ul>


    <h2 class="doAnchor">Plug-in Installation</h2>

    <p>The logback-beagle plug-in requires the Nebula Grid plug-in
    which must be installed first.</p>

    <dl>
      <dt>Step 1: Nebula Grid</dt>
      
      <dd>
      <p>The Nebula Grid plug-in which can be installed from
      <b>http://download.eclipse.org/technology/nebula/snapshot/</b>. Only
      the "Nebula Grid Feature" needs to be installed.</p>
      
      <p><img src="images/nebulaFeature.png" alt=""/></p>
      
      </dd>

      <dt>Step 2: Logbak-beagle</dt>
      
      <dd><p>The logback-beagle plug-in can be installed from
      <b>http://logback.qos.ch/p2/</b>. You need to select "Logback",
      "Logback Beagle" and "SLF4J" bundles for installation as shown
      below.</p>

      <p><img src="images/beagleFeature.png" alt=""/></p>
      </dd>
    </dl>
        
    
    <p>Restarting Eclipse should load the plugin. To access the Beagle
    View, either type A"lt-Shift-Q, Q" or select: <em>Window &gt; Show
    view &gt; Other... </em>. You should see the <em>Beagle</em> view
    nested in the <em>Logback</em> category. Selecting this view will
    add it to your workspace. It shouls looks as follows:</p>

    <p><img src="images/beagleView0.png" alt=""/></p>

    <h3>Configuring the client (logback.xml)</h3>
    
    <p>A single additional configuration line in <em>logback.xml</em>
    is sufficient to send log events from your application to
    logback-beagle.
    </p>
    
    <pre class="prettyprint source">&lt;configuration debug="true">
  &lt;!-- sends logs to logback-beagle --&gt;
  <b>&lt;consolePlugin /></b>
&lt;/configuration></pre>
  
	
   <p>Under the hood, <code>&lt;consolePlugin></code> element creates
   a <code>SocketAppender</code> which will send logging events to a
   TCP socket on <code>localhost</code> port
   <em>4321</em>. Logback-beagle launches the corresponding server
   listening on this port on localhost.
   </p>


   <h2 class="doAnchor" name="using">Using logback-beagle</h2>

   <p>Logback-beagle displays the events it receives in a table
   according to the layout format chosen by the user. Here is a screen
   shot of the Beagle View containing logging events.
   </p>

   <img src="images/beagleSample.png" alt=""/>

   <p>Clicking on any log line will scroll-lock (freeze) the
   view. Double clicking on that same line will release the scroll
   lock (unfreeze) the view. You can also release the scroll lock by
   clicking on <img src="images/play_doc.gif" alt="" style="display:
   inline;"/>. This icon becomes active (clickable) when the view is
   frozen.
   </p>

   <h3 class="doAnchor" name="using">Jump to caller/Expand caller data</h3>
   
   <p>Right-clicking on any line will reveal the following menu:</p>
   
   <p><img src="images/menu.png" alt=""/></p>

   <p>Selecting "Jump to caller" will move the edit cursor to the file
   and line number whence the logging statement issued.</p>

   <p>Selecting "Expand caller data" will reveal the stack trace of
   method calls upto eight levels deep. Here is a sample
   screen-shot:</p>

    <p><img src="images/callerData.png" alt=""/></p>

    <p>Not only are the callers of the log statement revealed, it
    becomes possible to jump to any of the listed callers. Right-click
    on a caller line. A menu will appear. Select "Jump to caller" in
    the menu to jump to the caller of your choice.
    </p>

    <p><img src="images/callerData-jump.png" alt=""/></p>

    <p>Caller data can be collapsed by selecting "Collapse caller
    data" from the said menu.</p>

    <h2 class="doAnchor">Preferences</h2>
    
    <p>Logback-beagle preferences can be found under the "Beagle"
    label nested under "Run/Debug" category. You can customize the
    output pattern to best suit your preferences. Changes take effect
    immediately.
    </p>

    <p><img src="images/preferences.png" alt=""/></p>


    <p>You may also change the font type and size used for displaying
    the log events via the Eclipse's preferences dialog as shown
    below:</p>

     <p><img src="images/font.png" alt=""/></p>
    
    <script src="templates/footer.js" type="text/javascript"></script>
    </div>
  </body>
</html>
